package chapter6;

import chapter3.AutoInc;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/7 16:13
 */
class Soup1 {
    private Soup1() {
    }

    public static Soup1 makeSoup() {
        return new Soup1();
    }
}

class Soup2 {
    private static Soup2 soup2 = new Soup2();

    private Soup2() {

    }

    public static Soup2 access() {
        return soup2;
    }

    public void f() {
    }
}

public class Lunch {
    public static void main(String[] args) {
        Soup1 soup1 = Soup1.makeSoup();
        Soup2 soup2 = Soup2.access();

        System.out.println(AutoInc.getTest());
    }

    void testPrivate() {
        // error!
        // Soup1 soup = new Soup1();
    }
}
